import request from '@/utils/request'

/**
 * 字典
 */
export function getDictByCode(dictCode) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/sysDictionary/getDictByCode',
    method: 'POST',
    data: { dictCode }
  })
}

export function queryPage(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/jdActivity/queryPage',
    method: 'post',
    data
  })
}

/**
 * 查询详情
 * @param {*} id
 */
export function get(id) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/jdActivity/get',
    method: 'get',
    params: { id }
  })
}

/**
 * 添加
 * @param {*} data
 */
export function insert(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/jdActivity/insert',
    method: 'post',
    data
  })
}

/**
 * 编辑
 * @param {*} data
 */
export function update(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/jdActivity/update',
    method: 'post',
    data
  })
}

/**
 * 删除
 * @param {*} id
 */
export function del(ids) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/jdActivity/deleteByIds',
    method: 'get',
    params: { ids }
  })
}
/**
 * 修改状态
 * @param {*} data
 */
 export function updateState(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/jdActivity/updateStatus',
    method: 'post',
    data
  })
}

/**
 * 获取出金账户
 * @param {*} data 
 * @returns 
 */
export function getAcc(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/account/getExpenditureAccount',
    method: 'post',
    data
  })
}
/**
 * 获取入金账户
 * @param {*} data 
 * @returns 
 */
export function getInAcc(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/account/getIncomeAccount',
    method: 'post',
    data
  })
}
 export function getRech(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/recharge/getRechargeJD ',
    method: 'post',
    data
  })
 }
 export function queryAccount(data) {
   return request({
     baseURL: '/API-ENTERPRISE-BACKEND/',
     url: 'backend/childAccount/queryItemList',
     method: 'post',
     data
   })
 }
 /**
  * 获取优惠券列表
  * @param data
  */
 export function queryCoupons(data) {
   return request({
     baseURL: '/API-ENTERPRISE-BACKEND/',
     url: '/backend/exchangeCoupon/query',
     method: 'post',
     data
   })
 }
 export function getRechOne(data) {
   return request({
     baseURL: '/API-ENTERPRISE-BACKEND/',
     url: '/backend/recharge/getOneList',
     method: 'post',
     data
   })
 }
 
